package com.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@Configuration
public class HandlerExceptionConfig {

    @ResponseBody
    @ExceptionHandler(Exception.class)
    public String handler(Exception e){

        return "出错了："+e.getMessage();

    }

}
